package com.hp.ongoing.app.view.strategy;

import java.awt.Toolkit;
import java.util.Timer;
import java.util.TimerTask;

import com.hp.ongoing.view.MainForm;

public class AtualizadorStatusEmissaoPrint extends TimerTask {

	private MainForm form;
	private Toolkit toolkit;
	private Timer timer;

	public AtualizadorStatusEmissaoPrint(MainForm form, Timer timer) {
		this.form = form;
		this.timer = timer;
		toolkit = Toolkit.getDefaultToolkit();
	}

	public void run() {
		form.atualizarStatusEmissaoPrint();
		System.out.println("running");
		if (EmissaoPrint.contadorFasesEmissaoPrint == EmissaoPrint.EMISSAO_PRINT_FASE_03) {	
			toolkit.beep();
			System.out.println("done");
			timer.cancel();
		}
	}
}